/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'
import ModuleLayout from '@/layout/module'

const bookRouter = {
  path: '/book',
  component: Layout,
  redirect: '/book/audit/index',
  name: 'book',
  meta: {
    title: '预约',
    icon: 'book',
    roles: ['admin', 'book']
  },
  children: [
    {
      path: '/book/audit',
      component: ModuleLayout,
      redirect: '/book/audit/index',
      meta: {
        title: '预约审核',
        icon: 'em-icon-countdown-o'
      },
      children: [
        {
          path: '/book/audit/index',
          component: () => import('@/views/book/audit/index'),
          meta: {
            title: '待审列表'
          },
          hidden: true
        },
        {
          path: '/book/audit/view/:id',
          component: () => import('@/views/book/view'),
          name: 'book/audit/view/:id',
          meta: {
            title: '预约申请审核'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/book/default',
      component: ModuleLayout,
      name: 'BookOrderIndex',
      redirect: '/book/default/index',
      meta: {
        title: '所有预约',
        icon: 'em-icon-content'
      },
      children: [
        {
          path: '/book/default/index',
          component: () => import('@/views/book/index'),
          meta: {
            title: '列表'
          },
          hidden: true
        },
        {
          path: '/book/default/create',
          component: () => import('@/views/book/update/index'),
          name: 'book/book/create',
          meta: {
            title: '平台预约'
          },
          hidden: true
        },
        {
          path: '/book/default/update/:id',
          component: () => import('@/views/book/update/index'),
          name: 'book/default/update/:id',
          meta: {
            title: '预约修改'
          },
          hidden: true
        },
        {
          path: '/book/default/view/:id',
          component: () => import('@/views/book/view'),
          name: 'book/default/view/:id',
          meta: {
            title: '详情'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/book/create',
      component: () => import('@/views/book/update/index'),
      name: 'book/create',
      meta: {
        title: '内部预约录入',
        icon: 'em-icon-order-edit'
      }
    }
  ]
}
export default bookRouter
